﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RonaldCamcam.XBeeFramework.Utilility
{
    public class XBeeUtility
    {
        public static string ConvertToHex(string asciiString)
        {           
            string hexOutput = string.Empty;
            char[] values = asciiString.ToCharArray();

            foreach (char letter in values)
            {
                // Get the integral value of the character.
                int value = Convert.ToInt16(letter);
                // Convert the decimal value to a hexadecimal value in string form.
                hexOutput += String.Format("{0:X}", value);
                //Console.WriteLine("Hexadecimal value of {0} is {1}", letter, hexOutput);
            }
            return hexOutput;
        }
    }
}
